package com.dutchboy.system.api.Factory;


import com.dutchboy.system.api.RemoteSystemService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


/**
 * @Author : zhen.xue
 * @Date: 2020-08-28 11:17
 */
@Slf4j
@Component
public class RemoteSystemFallbackFactory implements FallbackFactory<RemoteSystemService> {
    @Override
    public RemoteSystemService create(Throwable cause) {
        log.error("远程调用系统模块失败",cause);
        return new RemoteSystemService() {
            @Override
            public String echo(String string) {
                return "远程访问失败";
            }
        };
    }
}